import pkg/[keyring]

if not keyringAvailable():
  echo "Keyring is not going to work."

try:
  setPassword("my-service", "myuser", "secret")
except CatchableError as e:
  echo "error: ", e.msg

var password: string
try:
  let ret = getPassword("my-service", "myuser")
  echo $ret
  if ret.isSome:
    password = ret.get()
    echo "password: ", password
except CatchableError as e:
  echo "error: ", e.msg

try:
  deletePassword("my-service", "myuser")
except CatchableError as e:
  echo "error: ", e.msg
